<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript" src="<?=Q::ini('custom_system/base_url')?>js/validator.js"></script>
<fieldset><legend>查询条件</legend>
<form method="get" action="">
<?include(Q::ini('custom_system/elements_dir') . 'searchform_element.php');?>
<table class="form_table">
<tbody>
<tr>
	<th>选择账号</th>
	<td>
		<select name="bmail_account">
			<option value='' > -- 请选择一个账号 --</option>
			<?foreach ($bmailAccount as $k => $v):?>
			<option value="<?=$k?>" <?php if ($currentAccount == $k) echo "selected='selected'"; ?>><?=$k?></option>
			<?php endforeach ?>
		</select>
	</td>
</tr>
<tr>
	<td></td>
	<td><input type="submit" value="查询" class="button"></td>
</tr>
</tbody></table>
</form>
</fieldset>

 <table width="100%" class="list_table" >
        <tr>
            <th >ID</th>
            <th >名称</th>
            <th >客户数</th>
            <th >最后修改时间</th>
            <th >操作</th>
        </tr>
        
        <?foreach ($mailgrounp as $v):?>
        <tr>
            <th><?=$v["id"]?></th>
            <td><?=$v["listname"]?></td>
            <td><?=$v["contactcount"]?></td>
            <td><?=$v["modifiedDate"]?></td>
            <td>
	           <a href='<?=url('Sales::Edm/MailGroupList')?>&sub_action=add&bmail_account=<?=$currentAccount?>&lid=<?=$v["id"]?>'>添加客户</a> | 
	           <a href='<?=url('Sales::Edm/MailGroupList')?>&sub_action=del&bmail_account=<?=$currentAccount?>&lid=<?=$v["id"]?>'>删除客户</a>
        	</td></tr>
        <?endforeach;?>
</table>

<div class="action_form">

	 <?php if ($subAcitonDisplay == "add") { ?>
	 <form action="<?=url('Sales::Edm/MailGroupAdd')?>" method="post">
	 	 <input type="hidden" name="bmail_account" value="<?=$currentAccount?>" />
	 	 <input type="hidden" name="list_id" value="<?=$actionListID?>" />
		 <p>Emails:(Separated by ,)</p>
		 <p><textarea cols="80" rows="5" name="emails"></textarea></p>
		 <p><input type="submit" value="Add" class="add_btn"></p>
	 </form>
	 <?php } if ($subAcitonDisplay == "del") { ?>
	 <form action="<?=url('Sales::Edm/MailGroupDel')?>" method="post">
	 	<input type="hidden" name="bmail_account" value="<?=$currentAccount?>" />
	 	<input type="hidden" name="list_id" value="<?=$actionListID?>" />
		 <p>Emails:(Separated by ,)</p>
		 <p><textarea cols="80" rows="5" name="emails"></textarea></p>
		 <p><input type="submit" value="Del" class="add_btn"></p>
	 </form>
	  <?php } ?>
</div>
  
<?php $this->_endblock(); ?>